/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights
 * reserved. <a>http://www.cqcis.com</a>
 */
package com.cqcis.uip.base.framework.base.impl;

import com.cqcis.uip.base.framework.base.AbstractCommonSupport;
import com.cqcis.uip.base.framework.common.Role;
import com.cqcis.uip.base.framework.common.Task;
import com.cqcis.uip.base.framework.handlers.CommonService;
import com.cqcis.uip.base.framework.handlers.common.AbstractHttpClientHandler;

/**
 * HTTP CLIENT
 * 
 * @author huangmy
 * @date   2008-10-13
 */
public class DefaultHttpClientStub extends AbstractCommonSupport {
	private static final long serialVersionUID = 1L;
	private int threadNumberSchedule; // 执行sechdule方法的线程数
	private AbstractHttpClientHandler service; // 服务
	
	@Override
	protected CommonService getCommonService() {		
		return this.service;
	}
	
	public Role getRole() {		
		return Role.HTTP_CLIENT;
	}

	@Override
	protected int getThreadNumberSchedule() {
		return this.threadNumberSchedule;
	}
	
	@Override
	public void catchException(Task task, Throwable t) {
		this.service.catchException(task, t);
	}
	
	public void setThreadNumberSchedule(int threadNumberSchedule) {
		this.threadNumberSchedule = threadNumberSchedule;
	}
    	
	public void setService(AbstractHttpClientHandler service) {
		this.service = service;
	}
}
